<?php
/* @var $this StatusController */
/* @var $model Status */
/* @var $form CActiveForm */
?>
<div class="wide form">

<?php 
		$form=$this->beginWidget('CActiveForm', array(
		'action'=>Yii::app()->createUrl($this->route),
		'method'=>'POST',
		));
	?>
<!-- 
	<div class="row">
	<?php // $result=User::model()->getSalespeople();?>
		<?php // echo $form->label($model,'agent_id'); ?>
		<?php 
			//	if($model->agent_id==null)
			//	{
				//	echo $form->dropDownList($model, 'agent_id',CHtml::listData($result,'user_id','user_name'),array('prompt'=>'All'));
				//}else{
				//		echo $form->dropDownList($model, 'agent_id',array(Yii::app()->user->id=>Yii::app()->user->name));
			//	}
		?>
	</div>
 -->
		<div class="row">
			<?php echo $form->label($model,'last_called_date_and_time'); ?>
	
	  		<input type="text" id="lasttime1" name="Status[last_called_date_and_time]" size="10" value="<?php echo $model->last_called_date_and_time=='0000-00-00'?date("Y-m-d",strtotime("-7 day")):$model->last_called_date_and_time;?>" onClick="WdatePicker({startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})" " style="width:130px;" />
	  		<?php echo Yii::t('base','TO');?>
	  		<!-- callback_date_and_time 字段纯属借用赋值方便,无其他意义 -->
	  		<input type="text" id="lasttime2" name="Status[callback_date_and_time]" size="10" value="<?php echo $model->callback_date_and_time=='0000-00-00'?date("Y-m-d",strtotime("+1 days")):$model->callback_date_and_time;?>" onClick="WdatePicker({startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})" " style="width:130px;" /> 		
		</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton(Yii::t('base','search'),array('id'=>'submit')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- search-form -->
<?php 
//$arr=Yii::t('base','The first value cannot be less than second value');
Yii :: app()->clientScript->registerScript('search1', "
		$('#submit').click(function(){
		if($('#lasttime1').val()>$('#lasttime2').val())
		{
			alert('".Yii::t('base','The first value cannot be less than second value')."');
			$('#lasttime1').focus();
			return false;
		}
		});
		");
?>